<!DOCTYPE html>
<html>
	<head>
	<%@ page pageEncoding  = "UTF-8" %>
	<%@ page import = "java.util.*,com.tk.entity.*,com.tk.servlet.*" %>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../css/manage13.css" />
		<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
		<script type="text/javascript" src="../js/getBodyWidAndHei.js" ></script>
		<!--<script src="js/turnUp.js"></script>-->
		<script type="text/javascript" src="../js/time.js" ></script>
        <script type="text/javascript" charset="utf-8" src="../ueditor/ueditor.config.js"></script>
		<script type="text/javascript" charset="utf-8" src="../ueditor/ueditor.all.min.js"></script>
		<script type="text/javascript" charset="utf-8" src="../ueditor/lang/zh-cn/zh-cn.js"></script>
		
		
	</head>
	<body onload="getNowFormatDate()">
   <%
    Hero hero = (Hero)request.getSession().getAttribute("hero");
    request.setCharacterEncoding("UTF-8");
    Post themePost = (Post)request.getAttribute("themePost");
    Page pages = (Page)request.getAttribute("page");
    List<Post> contents = pages.getPosts();
  	//List<Post> contents = (List<Post>)request.getAttribute("contents");
   %>
		<!--头部部分-->
		<div class="title">
			<div class="date">
				<p></p>
			</div>
			
		</div>
		
		<!--左侧栏-->
		<div class="information">
			<ul>
				<li id="liFirst">
					<div class="headImg">
						<img src="../img/home/普通用户.jpg" />
					</div>
					<div id="myName">
						
						<p><%= hero.getHname() %></p>
						<br>
						<p>
						<%
							out.print(hero.getPos());
						%>
						</p>
						<br>
						<p><%= hero.getTeam() %></p><br />
					</div>
				</li>
				<li ><a href="PaginationTheme">天下形势</a></li>
				<li class="dropdown" ><a  href="servlet/findheroServlet?tog=repos">日理万机</a>
				<div class="dropdown-content">
			        <ul>
			        	<li><a href="findheroServlet?tog=repos">任用罢免</a></li>
			        	<li><a href="findheroServlet?tog=kill">生杀大权</a></li>
			        	<li><a href="manage.html">奖率三军</a></li>
			        	<li><a href="manage.html">调兵遣将</a></li>
			        </ul>
			    </div>
			    </li>
				<li ><a href="">知心交友</a></li>
				<li ><a href="../home/resume.jsp">英雄履历</a></li>
			</ul>
		</div>
		
		<!--论坛中间部分，呈现的是朋友的动态-->
		<div class="friends">
			<div class="friendsLeft">

					<div class="friendsText">
						<div class="friendsTextH4">
							<h4>朋友动态</h4>
						</div>
						<div class="friendsSelf">
							<div class="self">
								<div class="selfImg">
									<img src="../img/home/普通用户.jpg">
								</div>
								<div class="selfQuestion">
									<p>[<%= themePost.getPosterName() %>] <%= themePost.getTitle() %></p><br />
									<p><span>发表于 <%= themePost.getReplyTime() %>  最后回复  <%= themePost.getLastReply() %></span></p>
								</div>
							</div>
							<div class="selfTheyText">
								<p><%= themePost.getContent() %></p>
							</div>
						
						
						</div>
						<div class="answer">
							<div class="answerTitle">
								<h3>评论</h3>	
							</div>
							<div class="answerTextAll">
							<%
  								int i;
  								for( i=0;i<contents.size();i++ ){
  									Post content = contents.get(i);
  							 %>
								<div class="answerText">
									<div class="answerImg">
										<img src="../img/home/奖章1.png">
									</div>
									<div class="answerName">
										<p ><%= content.getPosterName() %>：<span><%= content.getContent() %></span></p>
										<div class="Atime">
											<p><%= content.getReplyTime() %></p>
										</div>
									</div>
									<div class="Deanswer">
										<p>
										<a href="../servlet/DeleteContent?id=<%= content.getId() %>&isTheme=0&theme=<%= themePost.getId() %>">删除</a>
										</p>
									</div>
								</div>
							<%
								}
							 %>
								<div class="answerPage">
								
									<form action="../servlet/PaginationTheme" method="post" >
										<a href="../servlet/PaginationTheme?currentPage=1&theme=<%=themePost.getId() %>" >首页</a>
										<a href="../servlet/PaginationTheme?currentPage=<%=pages.getCurrentPage()-1 %>&theme=<%= themePost.getId() %>" >上一页</a>
										
										<input type="hidden" name="theme" value=<%=themePost.getId() %>>
										<input type="number" name="currentPage" value=<%=pages.getCurrentPage() %> /> /<%= pages.getTatalPage() %>
										<input type="submit" value= "跳转" >
										

										<a href="../servlet/PaginationTheme?currentPage=<%=pages.getCurrentPage()+1 %>&theme=<%= themePost.getId() %>" >下一页</a>
										<a href="../servlet/PaginationTheme?currentPage=<%=pages.getTatalPage() %>&theme=<%= themePost.getId() %>" >尾页</a>
									</form>
								</div>
							</div>
						</div>
					
					</div>
				
					<!--论坛右侧部分，是文本编辑器，发表自己动态-->
									
			</div>
			<div class="myText">
			<form action = "../servlet/Reply" method = "post" >
				<input type="hidden"  name="theme" value="<%= themePost.getId() %>" /> 
				<div class="myTextButton">
					<input type="submit" value="回复" >						
				</div>
				<div class="myTextEr">
								
					<div class="myTextarea">
						<input name="title" type="text" placeholder="主题"/>
						<textarea name="content" rows="" cols="" placeholder="我想说…"></textarea>
					</div>
				</div>
			</form>
			</div>
		</div>
	</body>
</html>
